const express = require('express');
const router = express.Router();
const imageController = require('../controllers/imageController');
const { strictLimiter } = require('../middleware/rateLimiter');

router.post('/generate', strictLimiter, imageController.generateImage);

router.post('/edit', strictLimiter, imageController.upload.single('image'), imageController.editImage);

router.post('/compose', strictLimiter, imageController.upload.array('images', 3), imageController.composeImages);

router.post('/chat', strictLimiter, imageController.chat);

router.get('/status', (req, res) => {
  res.json({
    status: 'active',
    endpoints: {
      generate: 'POST /api/generate',
      edit: 'POST /api/edit',
      compose: 'POST /api/compose',
      chat: 'POST /api/chat'
    },
    model: 'gemini-2.5-flash-image-preview',
    version: '1.0.0'
  });
});

module.exports = router;